package com.weiqiao.mall.service;

import com.weiqiao.mall.domain.VarietyEntity;
import com.weiqiao.mall.service.vo.CascadeVO;
import com.weiqiao.mall.service.vo.CommodityTypeVO;
import org.bson.Document;
import org.bson.conversions.Bson;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 商品分类service层
 *
 * @author PENGLIWEI
 * @createDate 2019-10-25
 */
public interface IVarietyService {

    List<VarietyEntity> selectList(Document doc, Pageable pageable);

    Map getList(CommodityTypeVO commodityTypeVO);

    List<VarietyEntity> selectCompanyList(int company_id);

    List<VarietyEntity> selectCompanyList(int company_id, int is_home);

    boolean saveVariety(VarietyEntity varietyEntity);

    int getOrderLogCount(int company_id, Document doc);

    boolean deleteById(int company_id, String variety_id);

    VarietyEntity findVarietyById(String variety_id);

    VarietyEntity getVarietyById(Bson filter);

    boolean updateVariety(Bson filter, Document doc);

    /**
     * 获取宝贝分类 tree
     *
     * @param request
     * @return
     */
    Map getVarietyTreeList(HttpServletRequest request);

    /**
     * 保存宝贝分类
     *
     * @param commodityTypeVO
     * @return
     */
    Map saveVarietyList(CommodityTypeVO commodityTypeVO);

    /**
     * 获取所有二级分类
     *
     * @param company_id 公司id
     * @return
     */
    List<CascadeVO> selectSecondVarietyList(int company_id);
}
